package com.tiny.work.biz.dao;

import com.tiny.work.biz.entity.TbEnterpriseWatch;
import java.util.Date;
import java.util.List;
import org.apache.ibatis.annotations.Many;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

public interface TbEnterpriseWatchMapper {

  @Select("select * from tb_enterprise_watch  where id = #{enterpriseWatchId}")
  @Results({
      @Result(id = true, property = "id",
          column = "id"),
      @Result(id = true, property = "watchId",
          column = "watch_id"),
      @Result(property = "positions",
          column = "watch_id",
          javaType = List.class,
          many = @Many(select = "com.tiny.work.biz.dao.TbWatchPositionMapper.findPathsByWatchId"))
  })
  TbEnterpriseWatch getPathByWatchId(@Param("enterpriseWatchId") Long enterpriseWatchId,
      @Param("start") Date start,
      @Param("end") Date end);
}
